home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1382 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.4 KB

  1. Path: news.internetMCI.com!news-admin
  2. From: rknapp@mcimail.com   (Rich Knapp)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Faster FILE subroutines in standard C?
  5. Date: 10 Jan 1996 19:08:52 GMT
  6. Organization: InternetMCI
  7. Message-ID: <4d12s4$js8@news.internetmci.com>
  8. References: <Pine.A32.3.91.960103111942.52249A-100000-100000-100000-100000-100000@afep.yorku.ca>
  9. Reply-To: rknapp@mcimail.com (Rich Knapp)
  10. NNTP-Posting-Host: 166.35.209.252
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. In <Pine.A32.3.91.960103111942.52249A-100000-100000-100000-100000-100000@afep.yorku.ca>, Ken <ken@afep.yorku.ca> writes:
  14. >
  15. >I found that I was able to get 3-4 time faster performance by using good 
  16. >old ANSI C file accessing routines (like  fgets, fseek, ftell, ...etc.)
  17. >instead of C++ streams (like ifstream::getline, fstream::seekg, ...etc.)
  18. >I wrote the program originally in C++ (a simple little phonebook for my
  19. >own use) and it took about 9 seconds to scan a 100Kb file for a 3 byte
  20. >string!!!  Fed up, I rewrote it in C and voila! Now it takes 2 secs!
  21. >I'm using Borland C++ v2.0.
  22. >
  23.  
  24. Ken,
  25.  
  26.   You might try another compiler than Borland.  Other work I've done and 
  27. discussions with other developers have highlighted BI's implementation of
  28. streams in the early compilers is not so good.
  29.  
  30.   If you want, I can work up an example between my Turbo C++ 3.0 and
  31. WatCom C++ 10.5 but I don't know if that will help you any.
  32.  
  33. Rich
  34.